package com.hmall.search.web;

import com.hmall.common.dto.Filters;
import com.hmall.common.dto.FiltersVo;
import com.hmall.common.dto.Item;
import com.hmall.common.dto.PageDTO;
import com.hmall.search.service.SearchService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Description SearchController
 * @Author zhengyuan&junjun
 * @Date 2024-11-14
 */
@RestController
@RequestMapping(value = "/search")
public class SearchController {
    @Autowired
    private SearchService service;
    /**
     *
     * 过滤项聚合功能
     *
     * **/



 @PostMapping("/filters")
    public FiltersVo filters(@RequestBody Filters filters){
     return  service.filters(filters);
    }

    @PostMapping("/list")
    public PageDTO<Item> find(@RequestBody Filters filters){
        return  service.find(filters);
    }


}
